//
//  FactoryMessageTableViewCell.m
//  MagictoLane
//
//  Created by huayu01 on 2017/12/5.
//  Copyright © 2017年 HUAYU. All rights reserved.
//

#import "FactoryMessageTableViewCell.h"

@implementation FactoryMessageTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupCollectionView];
    // Initialization code
}

- (void)setupCollectionView {
    NSInteger constant = 5;
    NSInteger itemWidth = (SCREEN_WIDTH - 3 * constant * 2 - 40) / 4;
    UICollectionViewFlowLayout *flowLayout = [[UICollectionViewFlowLayout alloc] init];
    _pictureCollectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(20, 51, SCREEN_WIDTH - 20 * 2, 5) collectionViewLayout:flowLayout];
    //设置headerView的尺寸大小
    flowLayout.headerReferenceSize = CGSizeMake(SCREEN_WIDTH, 0.00001);
    //该方法也可以设置itemSize
    flowLayout.itemSize =CGSizeMake(itemWidth, itemWidth);
    _pictureCollectionView.backgroundColor = [UIColor clearColor];
    [_pictureCollectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:@"collectionViewCellID"];
    [self.contentView addSubview:_pictureCollectionView];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
